package com.chance.cc.crawler.development.command.script;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.job.domain.baidu.BaiDuCommonScript;
import com.chance.cc.crawler.development.command.job.domain.sohu.SoHuCommonScript;
import com.chance.cc.crawler.development.command.job.domain.tenxun.TenXunCommonScript;
import com.chance.cc.crawler.development.command.job.domain.tianya.TYCommonScript;
import com.chance.cc.crawler.development.command.job.domain.weixin.WeixinCommonScript;

/**
 * @author lt
 * @version 1.0
 * @date 2021-03-19 13:34:07
 * @email okprog@sina.com
 */
public class CommonScriptPublish {
    public static ScriptCommand scriptCommand = new ScriptCommand("192.168.1.215",9599);

    public static void publishCrawlerNodeScript(String domainId){

        HttpPage page = scriptCommand.publishCrawlerScript2Consul(domainId);
        System.out.println("发布采集脚本：" + page.getRawText());
    }

    public static void main(String[] args) {
//        publishCrawlerNodeScript(WeixinCommonScript.domain);
//        publishCrawlerNodeScript(TYCommonScript.domain);
//        publishCrawlerNodeScript(TenXunCommonScript.domain);
//        publishCrawlerNodeScript(SoHuCommonScript.domain);
//        publishCrawlerNodeScript(BaiDuCommonScript.domain);
        publishCrawlerNodeScript("toutiao");
//        publishCrawlerNodeScript("yidianzixun");
//        publishCrawlerNodeScript("du_app");
//        publishCrawlerNodeScript("zhihu");
//        publishCrawlerNodeScript("yishengzhan");
//        publishCrawlerNodeScript("zgjkjw");
//        publishCrawlerNodeScript("yiyaoxw");
    }
}
